/**
 * Money constitutes store and extends Item
 * 
 * @author Adrian 
 * @version 0.01
 */
public class Money extends Item
{
    private static int numberOfMoneys = 0;
    /**
     * Constructor for Money
     */
    public Money(int coordX, int coordY)
    {
        super('$', 's', coordX, coordY);
        //Track how much money is on the map.
        numberOfMoneys++;
    }
    
    /**
     * The remove() removes an intance of money from the screen 
     *  
     * @pre     
     * @param   none
     * @return  none     
     * @post    removal of money instance
     */
    public void remove()
    {
        super.remove();
        //Track removal of money from the map
        numberOfMoneys--;
        //Request next level if money is all collected
        if (numberOfMoneys <= 0)
            Runner.nextLevel();
            
    }
    /**
     * The add() adds score and a conformation of aquiriance of said money
     *  
     * @pre     
     * @param   none
     * @return  none     
     * @post    Updates status with confirmation text
     */
    public void add()
    {
        Runner.money += 5;
        Runner.player.updateScore(5);
        remove();
    }
}
